package com.ruoyi.project.utils;

import net.sourceforge.pinyin4j.PinyinHelper;

public class SZM {
    public static String getszm(String s){
        char[] chars = s.toUpperCase().toCharArray();
        StringBuilder sb = new StringBuilder();
        for (char c : chars) {
            if (c>=19968){
                String[] pinyin = PinyinHelper.toHanyuPinyinStringArray(c);
                sb.append(pinyin[0].charAt(0));
            }else {
                sb.append(c);
            }
        }
        return sb.toString().toUpperCase();
    }
}
